package a;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class shuzusort {
	public static void main(String[] args) {
		Random random=new Random();
		Scanner scanner=new Scanner(System.in);
		int a;
		a=scanner.nextInt();
		int b[]=new int [a];
		for(int i=0;i<a;i++) {
			b[i]=random.nextInt(100);
			System.out.print(b[i]+" ");
		}
		System.out.println();
		Arrays.sort(b);
		for(int c:b) {
			System.out.print(c+" ");
		}
	}
}
